<?php
/**
 * Created by PhpStorm.
 * User: lidan
 * Date: 2018/8/28
 * Time: 下午2:35
 */

namespace index\controllers;


use frame\Views;
use index\models\Users;
use frame\Redis;
class index
{
    protected $view;
    function __construct()
    {
        $this->view = new Views(C('app_name'));
    }

    public function testView()
    {
        $this->view->assign('name', 'welson');
        $this->view->assign(array('data' => array('tom', 'cat', 'dog')));
        $this->view->display('index/test');
    }

    public function testSql()
    {
        $user = new Users();
        $list = $user->getUserListByNickname('lidan');
        var_dump($list);
    }

    public function testRedis()
    {
        Redis::set('name', 'test_name', 300);
        echo Redis::get('name');
    }
}